/* eslint-disable */
/*
 * @Date: 2022-09-12
 * @LastEditors: zhx
 * @LastEditTime: 2022-09-12
 */
import Cookies from 'js-cookie'

// Cookie
export function getByCookie(name) {
	return Cookies.get(name)
}

export function setByCookie(name, value) {
	return Cookies.set(name, value)
}

export function removeByCookie(name) {
	return Cookies.remove(name)
}

// Session
export function getBySession(name) {
	return JSON.parse(window.sessionStorage.getItem(name))
}

export function setBySession(name, value) {
	window.sessionStorage.setItem(name, JSON.stringify(value))
}

export function removeBySession(name) {
	window.sessionStorage.removeItem(name)
}

// Local
export function getByLocal(name) {
	return JSON.parse(window.localStorage.getItem(name))
}

export function setByLocal(name, value) {
	window.localStorage.setItem(name, JSON.stringify(value))
}

export function removeByLocal(name) {
	window.localStorage.removeItem(name)
}